#ifndef COMPONENT_H
#define COMPONENT_H

#include "gameobject.h"

// component base
struct Component
{
    friend GameObject;

    GameObject &GetObject()
    {
        return *_obj;
    }

private:
    GameObject *_obj;
};

////////////////////
// core component
////////////////////

struct ActiveComponent : public Component
{
    ActiveComponent(bool active = true) : active(active) {}
    bool active;
};

struct TagComponent : public Component
{
    TagComponent(const std::string &tag) : tag(tag) {}
    std::string tag;
};

struct TransformComponent : public Component
{
    TransformComponent(const csugl::Transform &trans) : transform(trans) {}
    TransformComponent(csugl::Transform &&trans) : transform(trans) {}
    csugl::Transform transform;
};

struct CameraComponent : public Component
{
    CameraComponent(csugl::Ref<csugl::Camera> camera) : camera(camera) {}
    csugl::Ref<csugl::Camera> camera;
};


#endif